let loop = 1;
const promise = () => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve(loop);
      loop++;
    });
  });
};

promise().then((res) => {
  console.log(1, res);
  promise().then((res) => {
    console.log(2, res);
  }, (err) => {
    console.log(err);
  });
}, (err) => {
  console.log(err);
});

promise().then((res) => {
  console.log(3, res);
}, (err) => {
  console.log(err);
});

promise().then((res) => {
  console.log(4, res);
}, (err) => {
  console.log(err);
});